package com.itheima.controller;

import com.itheima.bean.Student;
import com.itheima.service.StudentService;
import com.itheima.service.impl.StudentServiceImpl;
import org.junit.Test;

import java.util.Date;
import java.util.List;

public class StudentController {

    private StudentService studentService = new StudentServiceImpl();

    @Test
    public void testFindAll(){
        List<Student> students = studentService.findAll();

        for (Student student : students) {
            System.out.println(student);
        }
    }

//    @Test
//    public void testSave(){
//        Student stu = new Student(null,"赵二",18,new Date());
//        Integer count = studentService.save(stu);
//        System.out.println(count);
//    }
//    @Test
//    public void testUpdate(){
//        Student stu = new Student(5,"赵二",28,new Date());
//        Integer count = studentService.update(stu);
//        System.out.println(count);
//    }
    @Test
    public void testDelete(){
        Integer count = studentService.delete(5,"赵二");
        System.out.println(count);
    }

}
